var util = require('../../utils/util.js')
var app = getApp()
Page({
  data: {
    userInfo: [],
    titleback : "https://liuyan.ijiechen.com/img/titleback.png",
    userback  : "https://liuyan.ijiechen.com/img/userback.png",
    pageback  : "https://liuyan.ijiechen.com/img/pageback.png",
    authorback: "https://liuyan.ijiechen.com/img/authorback2.png",
    dearimg   : "https://liuyan.ijiechen.com/img/dear222.png",
    fromimg   : "https://liuyan.ijiechen.com/img/from.png",
    liuyanban : "https://liuyan.ijiechen.com/img/liuyanban4.png",
    liuyan    : "https://liuyan.ijiechen.com/img/liuyan.png",
    liuyancontain: "哈哈哈哈哈啊哈哈哈啊哈哈哈哈哈哈啊哈哈哈啊哈哈哈哈哈哈啊哈哈哈啊哈哈哈哈哈哈啊哈哈哈啊哈哈哈哈哈哈啊哈哈哈啊哈哈哈哈哈哈啊哈哈哈啊哈哈哈哈哈啊哈哈哈啊哈哈哈哈哈啊哈哈哈啊哈哈哈哈哈哈啊哈哈哈啊哈哈哈哈哈哈啊哈哈哈啊哈" ,
    defaultSize: 'default',
    primarySize: 'default',
    warnSize: 'default',
    disabled: false,
    plain: false,
    loading: false,
  },
  onLoad: function () {
    var that = this
    app.getUserInfo(function (userInfo) {
      //更新数据
      that.setData({
        userInfo: userInfo
      })
      that.update()
    }),
    wx.request({
      // url: 'https://wang.1shangxueyuan.cn/test.php', //
      url: 'http://localhost/test.php', //
      data: {
        x: '',
        y: ''
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      success: function (res) {
        console.log(res.data)
        that.setData({
          liuyancontain: res.data
        })
      }  
    })
  },
  //下拉刷新
  // onPullDownRefresh: function () {
  //   var that = this;
  //   that.onLoad(that.data.dgGlobal_options);
  //   setTimeout(() => {
  //     wx.stopPullDownRefresh();
  //   }, 1000);  
  // },
  onShareAppMessage: function () {
    var that = this;
    var shareTitle = '留言板';
    var shareDesc  = '留言板小程序';
    var sharePath  = 'pages/liuyan/liuyan';
    return {
      title: shareTitle,
      desc: shareDesc,
      imageUrl: '',
      path: sharePath
    }
  },
  setliuyan:function(){
    console.log("我去留言了")
    wx.navigateTo({
      url: '../setliuyan/setliuyan',
    })
  }
})
